$("#content").html("<%= escape_javascript(render :partial => 'show') %>");

<%= toolbar :messages %>

$('.cont_conversation').validate({errorClass: "validation_error"});
<% unless @box.eql?'trash' %>
  $("#body").cleditor({
    width:493,
    controls:  "<%= SocialStream.cleditor_controls %>"     
  });

	var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
	if (message_hash && message_hash.length > 0){
		$.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
	}else{
		$.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});		
	}

<% else %>
	var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
	if (message_hash && message_hash.length > 0){
		$.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
	}else{
		$.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});		
	}
<% end %>
